<?php
if( !defined( 'PAGESEARCH' ) ): define( 'PAGESEARCH', 1 );
if( !defined( 'FILE_ROOT' ) ) include_once( '../../_prerun' );

/**
 * PAGE GERANT LA RECHERCHE LOCALE
 */
USE_LIB( 'Page' );
abstract class PageSearch extends Page
	{
	protected $m_object2filter = null;
	
	public function getSearchFieldname()
		{
		return 'f_lskwds';
		}
	
	public function getSearchFormname()
		{
		return 'FORM_LOCAL_SEARCH';
		}
		
	public function setSearchFilterTarget( $obj )
		{
		$this->m_object2filter =& $obj;
		$fls = new Form( $this->getSearchFormname() );
		$fls->add( new FormFieldInput( $this->getSearchFieldname(), false ) );
		$this->add( &$fls );
		$pro =& $this->getLocalSearchProcessor( $this->getSearchFieldname() );
		$this->m_pro =& $pro;
		$fls->process( $pro );
		}
	
	public function &getLocalSearchProcessor( $searchfieldname = null )
		{
		$fp = new LocalSearchProcessor();
		$fp->setFormSearchFieldName( $searchfieldname );
		$fp->setObjectToFilter( $this->m_object2filter );
		return $fp;
		}
#		
#	public function parseTemplate( &$tpl )
#		{
#		parent::parseTemplate( $tpl );
#		$tpl->formatWords( $this->m_pro->getKeywords(),'<strong class="b-res">','</strong>' );
#		}
	}
endif;
?>